/*
 * @Author: 我想吃余 483766615@qq.com
 * @Date: 2025-11-04 13:12:08
 * @LastEditors: 我想吃余 483766615@qq.com
 * @LastEditTime: 2025-11-04 13:41:58
 * @FilePath: /oscode/signal/volatite/test.cc
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
#include <iostream>
#include <signal.h>
#include <unistd.h>

using namespace std;

int flag = 1;

void hander(int signo)
{
    cout << "catch signal success, signo:" << signo << endl;
    flag = 0;
}

int main()
{
    signal(2, hander);
    while(flag);//故意不写
    cout << "process quit" << endl;
    return 0;
}